home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C & C++ Multimedia Cyber Classroom
/
C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso
/
src
/
fig08_08.jar
/
Ch08
/
Fig08_08
/
Fig08_08.cpp
next >
Wrap
C/C++ Source or Header
|
1997-10-27
|
717b
|
32 lines
// Fig. 8.8: fig08_08.cpp
// Test driver for HugeInt class
#include <iostream.h>
#include "hugeint1.h"
int main()
{
HugeInt n1( 7654321 ), n2( 7891234 ),
n3( "99999999999999999999999999999" ),
n4( "1" ), n5;
cout << "n1 is " << n1 << "\nn2 is " << n2
<< "\nn3 is " << n3 << "\nn4 is " << n4
<< "\nn5 is " << n5 << "\n\n";
n5 = n1 + n2;
cout << n1 << " + " << n2 << " = " << n5 << "\n\n";
cout << n3 << " + " << n4 << "\n= " << ( n3 + n4 )
<< "\n\n";
n5 = n1 + 9;
cout << n1 << " + " << 9 << " = " << n5 << "\n\n";
n5 = n2 + "10000";
cout << n2 << " + " << "10000" << " = " << n5 << endl;
return 0;
}